Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Return consistent empty slice from .All() methods #297

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

apricote
Copy link
Member

@apricote apricote commented Aug 8, 2023

The clients .All() & .AllWithOpts() methods returned an inconsistent slice value when no resources were found. Some clients returned a nil slice while others returned an empty slice with 0 entries.

This makes sure that all methods return empty slices except if an actual error occured.

The clients `.All()` & `.AllWithOpts()` methods returned an inconsistent
slice value when no resources were found. Some clients returned a `nil`
slice while others returned an empty slice with 0 entries.

This makes sure that all methods return empty slices except if an actual
error occured.
@apricote apricote added the backport release-1.x Open PR against release-1.x with these changes after the PR is merged. label Aug 8, 2023
@apricote apricote self-assigned this Aug 8, 2023
@apricote apricote requested a review from a team as a code owner August 8, 2023 10:48
@apricote apricote merged commit 88f5871 into main Aug 8, 2023
4 checks passed
@apricote apricote deleted the fix-all-empty-slice branch August 8, 2023 11:02
github-actions bot pushed a commit that referenced this pull request Aug 8, 2023
The clients `.All()` & `.AllWithOpts()` methods returned an inconsistent
slice value when no resources were found. Some clients returned a `nil`
slice while others returned an empty slice with 0 entries.

This makes sure that all methods return empty slices except if an actual
error occured.

(cherry picked from commit 88f5871)
apricote added a commit that referenced this pull request Aug 8, 2023
)

The clients `.All()` & `.AllWithOpts()` methods returned an inconsistent
slice value when no resources were found. Some clients returned a `nil`
slice while others returned an empty slice with 0 entries.

This makes sure that all methods return empty slices except if an actual
error occured.

(cherry picked from commit 88f5871)

Co-authored-by: Julian Tölle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-1.x Open PR against release-1.x with these changes after the PR is merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants